﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ReferralTracker.Data.Entities;
using ReferralTracker.BusinessObjects.Infrastructure;
using ReferralTracker.Data.Repositories;

namespace ReferralTracker.BusinessObjects {
    public class ReferralTransaction : BusinessObject {

        public ReferralTransaction() : base() {}
        public ReferralTransaction(ISession session) : base(session) {}

        public void AddReferral(Referral referral) {
            var referralRepo = new ReferralRepository(_context);

            referral.Date = DateTime.Now;
            referralRepo.Add(referral);
            SaveChanges();
        }
    }
}
